<include file="Ucenter@Public:header"/>
<div class="am-g">
	<div class="am-u-md-3">
		<include file="Ucenter@Public:left_menu"/>
	</div>
	<div class="am-u-md-9 am-cf">
		<div class="am-panel am-panel-default am-cf">
			<div class="am-panel-hd">
				<h3 class="am-panel-title">修改密码</h3>
			</div>
			<div class="am-panel-bd">
				<form class="am-form am-form-horizontal" action="__SELF__" method="post">
					<div class="Validform_checktip"></div>
					<div class="am-form-group">
						<label class="am-u-sm-2 am-form-label" for="inputPassword">原密码</label>
						<div class="am-u-sm-10">
							<input type="password" id="inputPassword"  class="span3" placeholder="请输入密码"  errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="old">
						</div>
					</div>
					<div class="am-form-group">
						<label class="am-u-sm-2 am-form-label" for="inputPassword">新密码</label>
						<div class="am-u-sm-10">
							<input type="password" id="inputPassword"  class="span3" placeholder="请输入密码"  errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password">
						</div>
					</div>
					<div class="am-form-group">
						<label class="am-u-sm-2 am-form-label" for="inputPassword">确认密码</label>
						<div class="am-u-sm-10">
							<input type="password" id="inputPassword" class="span3" placeholder="请再次输入密码" recheck="password" errormsg="您两次输入的密码不一致" nullmsg="请填确认密码" datatype="*" name="repassword">
						</div>
					</div>
					<div class="am-form-group">
						<div class="am-u-sm-10 am-u-sm-offset-2">
							<button type="submit" class="am-btn am-btn-primary">提 交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(document)
    	.ajaxStart(function(){
    		$("button:submit").addClass("log-in").attr("disabled", true);
    	})
    	.ajaxStop(function(){
    		$("button:submit").removeClass("log-in").attr("disabled", false);
    	});

	$("form").submit(function(){
		var self = $(this);
		$.post(self.attr("action"), self.serialize(), success, "json");
		return false;

		function success(data){
			if(data.status){
				self.find(".Validform_checktip").addClass('am-alert am-alert-primary').text(data.info);
				setTimeout(function(){
					self.find(".Validform_checktip").removeClass('am-alert am-alert-primary').text('');
					window.location.href = data.url;
				},3000);
			} else {
				self.find(".Validform_checktip").addClass('am-alert am-alert-warning').text(data.info);
				setTimeout(function(){
					self.find(".Validform_checktip").removeClass('am-alert am-alert-warning').text('');
				},3000);
			}
		}
	});
</script>
<include file="Ucenter@Public:footer"/>